import lazy from './modules/lazy'

export default {
  install(app) {
    // 自动注册组件
    const directives = import.meta.glob('./modules/*.js', {
      eager: true
    })
    for (const [key, value] of Object.entries(directives)) {
      // 循环注册
      const name = key.split('/')[2].replace('.js', '')
      app.directive(name, value.default)
    }
  }
}
